<?php
defined('_JEXEC') or die('Restricted access');
//jimport('joomla.html.toolbar');
//jimport( 'joomla.application.helper' ); 
//jimport('joomla.application.component.helper');

//require_once(JPATH_COMPONENT_ADMINISTRATOR.DS.'controller.php');



// Load the toolbar helper
//require_once( JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'toolbar.php' );

// echo FattureTooHelperToolbar::getToolBar();
//require_once(JApplicationHelper::getPath('toolbar'));

// Require specific controller 

$controllerName = JRequest::getVar('controller' );

switch ($controllerName)
{
	default:
		$controllerName = 'menu';
		// allow fall through
		

	case 'menu' :
	case 'societa':
		// Temporary interceptor
		$task = JRequest::getCmd('task');
		echo "admin...<br>";
		require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controllerName.'.php' );
		$controllerName = 'FattureTooController'.$controllerName;

		// Create the controller
		$controller = new $controllerName();

		// Perform the Request task
		$controller->execute( JRequest::getCmd('task') );

		// Redirect if set by the controller
		$controller->redirect();

		break;
}
/*
if($controllerName = 'societa') {
	$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php'; 
	if (file_exists($path)) {
		require_once $path;
	} else {
		$controller = ''; 
	} 
} 

// Create the controller 
$classname = 'FattureTooController'.$controller;
$controller = new $classname(); 
// Perform the Request task 
echo 'Pagina Principale <br>';
$controller->execute( JRequest::getVar( 'task' ) );
echo JRequest::getVar( 'task' );
 // Redirect if set by the controller 
$controller->redirect();
*/
?>
